package controllers;

/**
 * Created by grzegorz on 10/10/14.
 */
public enum Suits {
	SPADE ("S"), HEART ("H"), DIAMOND ("D"), CLUB ("C");

	private String text;

	private Suits( String s ) {
		this.text = s;
	}

	@Override
	public String toString() {
		return text;
	}

	public static Suits getRank( String text ) {
		for( Suits suit : values() ) {
			if( suit.text.equalsIgnoreCase( text ) )
				return suit;
		}
		throw new IllegalArgumentException( "Non-existent rank: " + text );
	}

}
